package org.freetek.linkdn.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper {

	private final static String DATABASE_NAME = "linkdn.db";
	private final static int DATABASE_VERSION = 2;
	private final static String PARAMS_TABLE_NAME = "params";

	// TODO column names should be extracted as constants
	private final static String PARAMS_TABLE_CREATE = "CREATE TABLE" + PARAMS_TABLE_NAME
			+ " (pk_params INTEGER PRIMARY KEY, param_name TEXT, param_value TEXT);";

	public DatabaseHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(PARAMS_TABLE_CREATE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// no need to add logic here ... for now
	}

}
